From d2ea22a405cfc28768527ed1c9e075f06a8b2003 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 27 Jun 2006 09:33:35 +0100 Subject: [PATCH] [HVM][VMX] Propagate debug exception to guest if no external debugger is enabled. Signed-off-by: George Dunlap --- xen/arch/x86/hvm/vmx/vmx.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index c3019e9510..a8dca0dd2b 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2080,10 +2080,19 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs regs) { void store_cpu_user_regs(struct cpu_user_regs *regs); - store_cpu_user_regs(®s); - __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS, PENDING_DEBUG_EXC_BS); - - domain_pause_for_debugger(); + if ( test_bit(_DOMF_debugging, &v->domain->domain_flags) ) + { + store_cpu_user_regs(®s); + domain_pause_for_debugger(); + __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS, + PENDING_DEBUG_EXC_BS); + } + else + { + vmx_reflect_exception(v); + __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS, + PENDING_DEBUG_EXC_BS); + } break; } -- 2.30.2